package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 * 大攻略
 */
@Setter
@Getter
public class Strategy extends BaseDomain {
    public static final int STATE_DISABLE = -1;//禁用
    public static final int STATE_NOMAL = 0;//正常
    public static final int STATE_HOT = 1;//推荐

    private Region place;//地区

    private String title;//标题

    private String subTitle;//副标题

    private String coverUrl;//封面

    private Integer state;//状态

    //获取json数据
    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("title", title);
        map.put("subTitle", subTitle);
        map.put("coverUrl", coverUrl);
        map.put("state", state);
        if (place != null) {
            map.put("placeId", place.getId());
        }
        return JSONUtil.toJSONString(map);
    }
}